package com.alks.function.mapper.stockdept.pcfactorystockquery;

import com.alks.entity.data.entity.PcSupplementHead;
import com.alks.function.data.dto.finance.mtlcosts.FinSuppHeadDto;
import com.alks.function.data.dto.finance.mtlcosts.SupCfmPrintDto;
import com.alks.function.data.dto.stockdept.pcfactorystockwork.SpHeadDto;
import com.alks.function.data.dto.stockdept.pcfactorystockwork.StcSupDto;
import com.alks.function.data.request.finance.mtlcosts.FinSuppHeadRequest;
import com.alks.function.data.request.stockdept.pcfactorystockwork.SpHeadRequest;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 补料总表 Mapper 接口
 * </p>
 *
 * @author ms
 * @since 2023-09-26
 */
@Mapper
public interface SD_SQ_PcSupplementHeadMapper extends BaseMapper<PcSupplementHead> {

    /*找出主表数据*/
    List<SpHeadDto> getSpHeadQuery(@Param("request") SpHeadRequest request, @Param("userName") String userName, @Param("companyId") String companyId);

    /*找出开补类型*/
    String getSpPartAppBl(String slipNo);

    /*更新打印字段*/
    void spPrintUpdate(String slipNo);

    /*转审核*/
    void spTurnCfmUpdate(@Param("slipNo") String slipNo, @Param("type") Integer type, @Param("userName") String userName, @Param("companyId") String companyId);

    /*删除补单数据*/
    void spAllDelete(String slipNo);

    /*更新备注*/
    void spRemakrUpdate(@Param("slipNo") String slipNo, @Param("remark") String remark);

    /**
     * 财务审核补料单主表查询
     * @param request 查询条件
     * @param companyId 公司ID
     * @return 查询结果
     */
    List<FinSuppHeadDto> suppHeadQuery(@Param("request") FinSuppHeadRequest request, @Param("companyId") String companyId);

    /**
     * 获取核算单头部数据
     */
    SupCfmPrintDto cfmPrintHeadQuery(@Param("slipNo") String slipNo, @Param("lotNo") String lotNo, @Param("companyId") String companyId);

    /**
     * 获取补料单头部数据
     *
     * @return
     */
    List<StcSupDto> stitchSuppBack(@Param("slipNo") String slipNo, @Param("companyId") String companyId);

}
